home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / DELPHI / TPOP332.ZIP / MAILBASE.INT < prev    next >
Encoding:
Text File  |  1996-06-29  |  2.1 KB  |  78 lines

  1. unit mailbase;
  2.  
  3. interface
  4.  
  5. uses
  6.   Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Windows,
  7.   ExtCtrls, MailUtil, WinSock;
  8.  
  9. type
  10.   EMailError = class(Exception);
  11.   ESocketError = class(Exception);
  12.   ECanceledError = class(Exception)
  13.     constructor Create;
  14.   end;
  15.   ETimedOutError = class(Exception)
  16.     constructor Create;
  17.   end;
  18.  
  19.   TMailBase = class(TComponent)
  20.   private
  21.     { Private declarations }
  22.     FServer : string;
  23.     FTimeOut : Integer;
  24.     FLogFileName : string;
  25.     FDefaultPort : word;
  26.     InvWnd : THandle;
  27.     function GetOnLine : boolean;
  28.   protected
  29.     { Protected declarations }
  30.     MyWSAData : TWSAData;
  31.     TheSocket : TSocket;
  32.     AsyncHandle : THandle;
  33.     ServerInAddr : u_Long;
  34.     ServerIPAddr : string;
  35.     ThePort : word;
  36.     Timer : TTimer;
  37.     CurTick : Integer;
  38.     WsInitCount : Integer;
  39.     Log : TStrings;
  40.     TimedOut : boolean;
  41.     Canceled : boolean;
  42.     HostFound : boolean;
  43.     ServiceFound : boolean;
  44.     Connected : boolean; //new
  45.     DataHasArrived : boolean; //new
  46.     ReadyToSend : boolean; //new, not used
  47.     AsyncError : boolean;
  48.     ErrorNo : word;
  49.     ServiceName : string;
  50.     procedure WndProc(var Msg : TMessage);
  51.     procedure TimerOnTimer(Sender : TObject);
  52.     procedure TimerOn;
  53.     procedure TimerOff;
  54.     procedure ReInit; virtual;
  55.     procedure ResolveRemoteHost;
  56.     procedure GetService;
  57.     procedure OpenSocket;
  58.     procedure Connect;
  59.   public
  60.     { Public declarations }
  61.     constructor Create(AOwner : TComponent); override;
  62.     destructor Destroy; Override;
  63.     procedure WriteLogFile;
  64.     procedure Cancel; virtual;
  65.     procedure Open; virtual; {11.4}
  66.     procedure Close; virtual;
  67.     property LogFileName : string read FLogFileName write FLogFileName;
  68.     property DefaultPort : word read FDefaultPort write FDefaultPort;
  69.     property OnLine : boolean read GetOnLine;
  70.   published
  71.     { Published declarations }
  72.     property Server : string read FServer write FServer;
  73.     property TimeOut : Integer read FTimeOut write FTimeOut default 60;
  74.   end;
  75.  
  76. implementation
  77.  
  78.